//
//  AboutUsViewController.m
//  parent
//
//  Created by IreWesT on 15/6/1.
//  Copyright (c) 2015年 ci123. All rights reserved.
//

#import "AboutUsViewController.h"

@interface AboutUsViewController ()

@end

@implementation AboutUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self _initView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)_initView {
    if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
        self.edgesForExtendedLayout = UIRectEdgeNone;
    
    self.view.backgroundColor = UIColorMake(244, 244, 244);

    UIImageView *logo = [[UIImageView alloc] initWithFrame:CGRectMake((APP_SCREEN_WIDTH - 90) / 2, 47, 90, 90)];
    logo.backgroundColor = [UIColor clearColor];
    logo.image = [UIImage imageNamed:@"about_icon_logo"];
    [self.view addSubview:logo];
    
    UILabel *detail = [[UILabel alloc] initWithFrame:CGRectMake(36, logo.bottom + 21, APP_SCREEN_WIDTH - 36 * 2, 200)];
    detail.textColor = UIColorMake(45, 45, 45);
    detail.backgroundColor = [UIColor clearColor];
    detail.textAlignment = NSTextAlignmentLeft;
    detail.numberOfLines = 0;
    
    NSString *str = @"       小康轩家园共育是由幼儿教育领导品牌康轩文教集团，联手全国领先的孕婴童网络平台育儿网（www.ci123.com）合力打造。为幼儿园提供便捷的管理平台，同时内置康轩优质教材内容以及育儿网早教资源，线下教学与线上知识同步，让老师轻松巩固教学知识，让家长无忧了解园所动态，实现全方位的家园互动。";
    //设置行间距的代码
    NSMutableAttributedString * attributedString1 = [[NSMutableAttributedString alloc] initWithString:str];
    NSMutableParagraphStyle * paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle1 setLineSpacing:8];
    [attributedString1 addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [str length])];
    [detail setAttributedText:attributedString1];
    detail.font = [UIFont systemFontOfSize:14];
    [self.view addSubview:detail];
    
    UIImageView *webImage = [[UIImageView alloc] initWithFrame:CGRectMake((APP_SCREEN_WIDTH - 297) / 2, APP_SCREEN_HEIGHT - 20 - 31 - 64, 297, 31)];
    webImage.backgroundColor = [UIColor clearColor];
    webImage.image = [UIImage imageNamed:@"about_icon_web"];
    [self.view addSubview:webImage];
    
    UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 20 , 44, 44)];
    button.showsTouchWhenHighlighted = YES;
    button.backgroundColor = [UIColor clearColor];
    button.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 30);
    [button setImage:[UIImage imageNamed:@"nav_btn_back"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(backPage:) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
    
    UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
                                   initWithTitle:@""
                                   style:UIBarButtonItemStylePlain
                                   target:nil
                                   action:nil];
    self.navigationItem.backBarButtonItem=backButton;
}
-(void)backPage:(id)button{
    [self.navigationController popViewControllerAnimated:YES];
}
@end
